<template>
  <el-tooltip
    :class="['tooltip-wraper','tooltip-'+type]"
    effect="dark"
    :content="content"
    placement="top"
  >
    <i v-if="icon" :class="[iconList[icon]?iconList[icon]:`${icon} iconfont`]" @click="handleTipDo" />
  </el-tooltip>
</template>
<script>

export default {
  props: {
    type: {
      type: String
    },
    content: String,
    icon: String
  },
  data() {
    return {
      iconList: {
        edit: 'el-icon-edit',
        delete: 'el-icon-delete',
        refresh: 'el-icon-refresh',
        operation: 'el-icon-s-operation',
        check: 'el-icon-circle-check',
        warning: 'el-icon-warning-outline',
        tickets: 'el-icon-tickets',
        view: 'el-icon-view'
      }
    }
  },
  methods: {
    handleTipDo() { // 操作
      this.$emit('click')
    }
  }
}
</script>
<style lang="less" scoped>
.tooltip-wraper{
  cursor: pointer;
  font-size: 20px;
  margin-right: 10px;
  color: #217dfa;
}
.tooltip-warning{
  color: #BD3124;

}
</style>
